package test;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadRemoveTesst {

	public static void main(String[] args) {

		ExecutorService newCachedThreadPool = Executors.newCachedThreadPool();

		newCachedThreadPool.submit(new Runnable() {

			@Override
			public void run() {
				int i = 0;
				while (true) {
					System.out.println("干活" + i);
					i++;
					try {
						Thread.sleep(100L);
					} catch (InterruptedException e) {
						System.out.println("回家回家");
						break;
					}
				}
			}
		});

		newCachedThreadPool.shutdownNow();
		System.out.println("下雨了收衣服了！");

	}

}
